package cn.wujiangbo.utils;

import org.I0Itec.zkclient.ZkClient;

/**
 * @description: ZK工具类（单例模式获取ZK客户端对象）
 * @auth: wujiangbo
 * @date: 2022-04-08 11:47
 */
public class ZkTools {

    private static ZkClient INSTANCE;

    private ZkTools() {
    }

    public static ZkClient getInstance() {
        if (INSTANCE == null) {
            synchronized (ZkTools.class) {
                if (INSTANCE == null) {
                    INSTANCE = new ZkClient("127.0.0.1:2181", 5000);
                }
            }
        }
        return INSTANCE;
    }
}